{% extends "base.html" %}
{% load static %}
{% load gravatar %}



{% block title %}{{ user0.username }}'s Profile - RMG{% endblock %}

{% block extrahead %}
<link href="{% static 'css/main.css' %}" rel="stylesheet" type="text/css"/>
{% endblock %}

{% block navbar_items %}{% endblock %}

{% block page_title %}{{ user0.username }} ({{ user0.get_full_name }}){% endblock %}

{% block page_body %}

<p>{% gravatar user0.username 80 %}</p>

<table>
{% if user.is_authenticated %}
    <tr>
        <td class="key">Name:</td>
        <td class="value">{{ user0.get_full_name }}</td>
    </tr>
    <tr>
        <td class="key">Email:</td>
        <td class="value">{{ user0.email }}</td>
    </tr>
    <tr>
        <td class="key">Organization:</td>
        <td class="value">{{ userProfile.organization }}</td>
    </tr>
    <tr>
        <td class="key">Website:</td>
        <td class="value"><a href="{{ userProfile.website }}" target="_blank">{{ userProfile.website }}</a></td>
    </tr>
    <tr>
        <td class="key">Bio:</td>
        <td class="value">{{ userProfile.bio }}</td>
    </tr>
{% endif %}
</table>
<br/>

{% if user == user0 %}
<p>
   <a href="{% url 'edit-profile' %}" title="Edit profile"><button>Edit Profile</button></a>
</p>
{% endif %}


{% if user == user0 %}
<h2>Arkane Pressure Dependent Networks</h2>

<table class="networks">
    <tr>
        <th style="width: 8em;">Network Id</th>
        <th>Network Title</th>
        <th style="width: 8em;"></th>
    </tr>
{% for network in networks %}
    <tr>
        <td><a href="{% url 'pdep:network-index' networkKey=network.pk %}">{{ network.pk|slice:":8" }}</a></td>
        <td><a href="{% url 'pdep:network-index' networkKey=network.pk %}">{{ network.title }}</a></td>
        <td style="font-size: 80%; white-space: nowrap;">Last modified on {{ network.getLastModifiedDate }}</td>
    </tr>
{% endfor %}
</table>
<br/>
{% endif %}

{% endblock %}
